Zigbee Switch: Fix Climax power meter scaling - #3205
Conversation
|
Hi @cjswedes, I hope you're doing well. Whenever you have a chance, would you or someone on the team be able to take a look at this PR? I noticed that the The change is intentionally scoped to If a different approach would be preferable, or if any additional validation is needed, I would be very happy to make any necessary changes. Thank you very much for your time and for reviewing contributions to the project. |
|
Invitation URL: |
|
zigbee-switch_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against 184101a |
Test Results 73 files 541 suites 0s ⏱️ For more details on these errors, see this check. Results for commit 184101a. |
|
Thank you for putting up this change to address this issue, I think there is a simpler way to address the issue rather than adding another nested subdriver. First, some context. The zigbee-switch-power subdriver itself is a bit useless IMO. Basically all these subdrivers do is set divisor/multipliers to be used in the Since the fix here is to use the defaults, rather than adding nested subdriver which then overrides the already overridden defaults with the defaults again, we should just have this device stop using the zigbee-switch-power subdriver entirely. Remove it from the fingerprints.lua file and then your tests pass. You then do not need the nested subdriver. |
Check all that apply
Type of Change
Checklist
Description of Change
Summary
ActivePowerto the SDK-standard handler.InstantaneousDemandto the SDK-standard handler.Root cause
The shared
zigbee-switch-powercompatibility handlers divide reported values by the configured divisor but do not apply the corresponding multiplier. The sharedInstantaneousDemandpath also emits a kW-scaled value as watts without multiplying by 1000.Changing these shared handlers globally could alter established compatibility behavior for other fingerprinted devices.
Implementation
The nested subdriver matches only manufacturer
ClimaxTechnologyand modelPSM_00.00.00.35TC. It overrides only Electrical MeasurementActivePowerand Simple MeteringInstantaneousDemand, delegating both attributes to the existing SDK-standard handlers.The shared compatibility handlers and all non-Climax device behavior remain unchanged.
Hardware validation
No SmartThings hub or physical Climax device was used. Automated integration tests verify driver and subdriver routing, multiplier/divisor field use, numerical scaling, kW-to-W conversion, and emitted
powerMeterevents.The physical-device test plan is to pair a
PSM_00.00.00.35TCwith a SmartThings hub and verify report ordering, endpoint behavior, and emitted watt values against a known load when hardware is available. That hardware validation was not performed for this change, so firmware report ordering, endpoint quirks, and deployed-device behavior remain unverified.Fixes #236
Summary of Completed Tests
test_switch_power: 7/7 passedtest_aurora_relay: 4/4 passedtest_ledvance_metering_plug: 4/4 passed